less than a full pte and operation requires cmpxchg.
Signed-off-by: Keir Fraser <keir@xensource.com>
}
/* Turn a sub-word access into a full-word access. */
- if (bytes != sizeof(physaddr_t))
+ if ( bytes != sizeof(physaddr_t) )
{
int rc;
physaddr_t full;
val &= (((physaddr_t)1 << (bytes*8)) - 1);
val <<= (offset)*8;
val |= full;
+ /* Also fill in missing parts of the cmpxchg old value. */
+ old &= (((physaddr_t)1 << (bytes*8)) - 1);
+ old <<= (offset)*8;
+ old |= full;
}
/* Read the PTE that maps the page being updated. */